package com.Main.faislamovers;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class PyOnCash extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		setContentView(R.layout.payment_on_cash);

		final TextView source_to_destination = (TextView) findViewById(R.id.source_to_destination);
		final TextView txt_date = (TextView) findViewById(R.id.date);
		SharedPreferences pref = getSharedPreferences(
				AppConstants.PREFERENCES_NAME, 0);
		String source = pref.getString(AppConstants.SOURCE, null);
		String destination = pref.getString(AppConstants.DESTINATION, null);
		if (!source.equals(null) && !destination.equals(null)) {
			source_to_destination.setText(source.toUpperCase() + " To " + destination.toUpperCase());
		}

		String date = pref.getString(AppConstants.DATE, null);
		if (!date.equals(null)) {
			txt_date.setText(date);
		}
		Button btn_back_to_main = (Button) findViewById(R.id.btn_back_to_main_xml);
		btn_back_to_main.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(PyOnCash.this, MainActivity.class);
				intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(intent);

			}
		});
	}

}
